<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>js生成div</title>
</head>
<body>
<div>111</div>
<script>
    var div = document.createElement("div");
    div.innerHTML = "nihao";
    document.body.appendChild(div);
</script>
</body>
</html>